<?php

require_once "html/spDiv.php";

class spButtons extends spDiv
{
	private $arButtons;
	private $orientation = "hortizontal";	// possible values: "horizontal", "vertical"

	public function __construct( $arButtons )
	{
		parent::__construct();
		
		$this->arButtons = $arButtons;
	}
	
	public function setOrientation( $orientation )
	{
		$this->orientation = $orientation;
	}
	
	public function render( $indent=0 )
	{
		// we take control of the render of the array of buttons this will allow me to handle the layout

		$end = end($this->arButtons);
		
		foreach ( $this->arButtons as $b )
		{
			$b->render();
			
			if ( $this->orientation=="vertical" && $b!=$end )
			{
				echo "<br/>";
			}
		}
	
		parent::render( $indent );
	}
}

?>